/*  Copyright (c) 2012 William Rogers and James Boud

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

using System;
using System.Collections.Generic;
using SlimDX;
using SlimDX.Direct3D11;
using Microsoft.Xna.Framework.Content;
using JBBRXG11ContentEffect;
using System.Windows.Forms;

namespace JBBRXG11
{
    public class Effect : ContentTypeReader<Effect>, IDisposable
    {
        // Cache the byte code of shaders on request
        // to avoid recompilation
        static SlimDX.D3DCompiler.ShaderBytecode[] cache
            = new SlimDX.D3DCompiler.ShaderBytecode[] { null, null, null, null, null, null, null, null, null, null };
        static int cachenext = 0;

        GraphicsDevice device;
        SlimDX.Direct3D11.Effect dxeffect;
        SlimDX.D3DCompiler.ShaderBytecode dxbytecode;
        EffectTechnique currenttechnique;
        bool isdisposed;

        public SlimDX.Direct3D11.Effect DX_Effect { get { return dxeffect; } }

        protected override Effect Read(ContentReader input, Effect existingInstance)
        {
            // It would seem sensible to use this instance of the object.
            // However the ContentManager appears to only maintain one,
            // and the effect is to overwrite an old effect. Hence the 'new'
            Effect neweffect = new Effect();
            neweffect.ProcessInfo(Game.GraphicsDevice, input.ReadString());
            //GraphicsDeviceManager.GetGame(Game.GraphicsDevice).UserContentAdd(neweffect);
            return neweffect;
        }

        public Effect()
        {
            dxeffect = null;
            dxbytecode = null;
            isdisposed = false;
        }

        internal Effect(string source, ref int cacheid)  // Create or access an effect with cached code
        {
            ProcessInfo(Game.GraphicsDevice, source, ref cacheid);
            //GraphicsDeviceManager.GetGame(Game.GraphicsDevice).UserContentAdd(this);
        }

        internal Effect(string source)  // Create an effect from shader source
        {
            ProcessInfo(Game.GraphicsDevice, source);
            //GraphicsDeviceManager.GetGame(Game.GraphicsDevice).UserContentAdd(this);
        }


        void ProcessInfo(GraphicsDevice dev, string source)
        {
            device = dev;
            dxbytecode = SlimDX.D3DCompiler.ShaderBytecode.Compile(source, "fx_5_0");
            dxeffect = new SlimDX.Direct3D11.Effect(device.DX_Device, dxbytecode);
            currenttechnique = new EffectTechnique(this, device, dxeffect.GetTechniqueByIndex(0));
            isdisposed = false;
            GraphicsDeviceManager.GetGame(Game.GraphicsDevice).UserContentAdd(this);
        }

        void ProcessInfo(GraphicsDevice dev, string source, ref int cacheid)
        {
            device = dev;
            dxbytecode = null;
            if (cacheid < 0)
            {
                if (cachenext >= cache.Length)
                {
                    ProcessInfo(device, source);
                    return;
                }
                cacheid = cachenext;
                cachenext++;
                cache[cacheid] = dxbytecode = SlimDX.D3DCompiler.ShaderBytecode.Compile(source, "fx_5_0");
            }
            dxeffect = new SlimDX.Direct3D11.Effect(device.DX_Device, cache[cacheid]);
            //dxeffect = SlimDX.Direct3D11.Effect.FromStream(device.DX_Device, cache[cacheid].Data, "fx_4_0");
            currenttechnique = new EffectTechnique(this, device, dxeffect.GetTechniqueByIndex(0));
            isdisposed = false;
            GraphicsDeviceManager.GetGame(Game.GraphicsDevice).UserContentAdd(this);
        }

        public EffectTechniqueCollection Techniques
        { get { return new EffectTechniqueCollection(device, this); } }

        public EffectTechnique CurrentTechnique { get { return currenttechnique; } set { currenttechnique = value; } }

        public GraphicsDevice GraphicsDevice { get { return device; } }

        public EffectParameterCollection Parameters { get { return new EffectParameterCollection(this); } }

        public virtual void Begin()
        {
        }

        public void End()
        {
        }

        public void Dispose()
        {
            if (!isdisposed)
            {
                if (dxeffect != null) dxeffect.Dispose();
                if (dxbytecode != null) dxbytecode.Dispose();
                isdisposed = true;
            }
        }

        public bool IsDisposed { get { return isdisposed; } }
    }

    public class EffectTechniqueCollection : IEnumerable<EffectTechnique>, IEnumerator<EffectTechnique>
    {
        GraphicsDevice device;
        Effect effect;
        int count;
        int current;

        internal EffectTechniqueCollection(GraphicsDevice dev, Effect eff)
        {
            device = dev;
            effect = eff;
            count = effect.DX_Effect.Description.TechniqueCount;
            current = -1;
        }

        public int Count { get { return count; } }

        public EffectTechnique this[int index]
        {
            get
            {
                return new EffectTechnique(effect, device,
                                           effect.DX_Effect.GetTechniqueByIndex(index));
            }
        }
        public EffectTechnique this[string name]
        {
            get
            {
                return new EffectTechnique(effect, device,
                                           effect.DX_Effect.GetTechniqueByName(name));
            }
        }
        public IEnumerator<EffectTechnique> GetEnumerator() { return this; }
        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this; }
        public EffectTechnique Current { get { return this[current]; } }
        public void Dispose() { }
        object System.Collections.IEnumerator.Current { get { return this[current]; } }
        public bool MoveNext() { current++; return current < count; }
        public void Reset() { current = -1; }
    }

    public class EffectParameter
    {
        EffectVariable effectvar;
        static Matrix[] matrixarraycache = null;

        internal EffectParameter(EffectVariable ev)
        {
            effectvar = ev;
        }

        public void SetValue(Microsoft.Xna.Framework.Matrix value)
        {
            SlimDX.Matrix dxmat;
            dxmat.M11 = value.M11;
            dxmat.M12 = value.M12;
            dxmat.M13 = value.M13;
            dxmat.M14 = value.M14;
            dxmat.M21 = value.M21;
            dxmat.M22 = value.M22;
            dxmat.M23 = value.M23;
            dxmat.M24 = value.M24;
            dxmat.M31 = value.M31;
            dxmat.M32 = value.M32;
            dxmat.M33 = value.M33;
            dxmat.M34 = value.M34;
            dxmat.M41 = value.M41;
            dxmat.M42 = value.M42;
            dxmat.M43 = value.M43;
            dxmat.M44 = value.M44;
            EffectMatrixVariable ev_world = effectvar.AsMatrix();
            ev_world.SetMatrix(dxmat);
        }

        public void SetValue(Microsoft.Xna.Framework.Matrix[] value)
        {
            if (matrixarraycache == null || value.Length != matrixarraycache.Length)
                matrixarraycache = new Matrix[value.Length];
            for (int m = 0; m < value.Length; m++)
            {
                matrixarraycache[m].M11 = value[m].M11;
                matrixarraycache[m].M12 = value[m].M12;
                matrixarraycache[m].M13 = value[m].M13;
                matrixarraycache[m].M14 = value[m].M14;
                matrixarraycache[m].M21 = value[m].M21;
                matrixarraycache[m].M22 = value[m].M22;
                matrixarraycache[m].M23 = value[m].M23;
                matrixarraycache[m].M24 = value[m].M24;
                matrixarraycache[m].M31 = value[m].M31;
                matrixarraycache[m].M32 = value[m].M32;
                matrixarraycache[m].M33 = value[m].M33;
                matrixarraycache[m].M34 = value[m].M34;
                matrixarraycache[m].M41 = value[m].M41;
                matrixarraycache[m].M42 = value[m].M42;
                matrixarraycache[m].M43 = value[m].M43;
                matrixarraycache[m].M44 = value[m].M44;
            }
            EffectMatrixVariable ev_world = effectvar.AsMatrix();
            ev_world.SetMatrixArray(matrixarraycache);
        }

        public void SetValueTranspose(Microsoft.Xna.Framework.Matrix value)
        {
            SetValue(Microsoft.Xna.Framework.Matrix.Transpose(value));
        }

        public void SetValue(Texture2D value)
        {
            EffectResourceVariable ev_world = effectvar.AsResource();
            ev_world.SetResource(value.View);
        }

        public void SetValue(Texture3D value)
        {
            EffectResourceVariable ev_world = effectvar.AsResource();
            ev_world.SetResource(value.View);
        }

        public void SetValue(TextureCube value)
        {
            EffectResourceVariable ev_world = effectvar.AsResource();
            ev_world.SetResource(value.View);
        }

        public void SetValue(ComputeBuffer value)
        {
            if (value.DX_ResourceView != null)
            {
                EffectResourceVariable ev_buff = effectvar.AsResource();
                ev_buff.SetResource(value.DX_ResourceView);
            }
            else
            {
                EffectUnorderedAccessViewVariable ev_cbuff = effectvar.AsUnorderedAccessView();
                ev_cbuff.SetView(value.DX_UnorderedView);
            }
        }

        public void SetValue(bool value)
        {
            EffectScalarVariable ev = effectvar.AsScalar();
            ev.Set(value);
        }

        public void SetValue(float value)
        {
            EffectScalarVariable ev = effectvar.AsScalar();
            ev.Set(value);
        }

        public void SetValue(Microsoft.Xna.Framework.Vector2 value)
        {
            Vector2 copy;
            copy.X = value.X;
            copy.Y = value.Y;
            EffectVectorVariable ev_world = effectvar.AsVector();
            ev_world.Set(copy);
        }

        public void SetValue(Microsoft.Xna.Framework.Vector3 value)
        {
            Vector3 copy;
            copy.X = value.X;
            copy.Y = value.Y;
            copy.Z = value.Z;
            EffectVectorVariable ev_world = effectvar.AsVector();
            ev_world.Set(copy);
        }

        public void SetValue(Microsoft.Xna.Framework.Vector4 value)
        {
            Vector4 copy;
            copy.X = value.X;
            copy.Y = value.Y;
            copy.Z = value.Z;
            copy.W = value.W;
            EffectVectorVariable ev_world = effectvar.AsVector();
            ev_world.Set(copy);
        }
    }

    public class EffectParameterCollection : IEnumerable<EffectParameter>, IEnumerator<EffectParameter>
    {
        Effect effect;
        int current;

        internal EffectParameterCollection(Effect eff)
        {
            effect = eff;
            current = -1;
        }

        public int Count { get { return effect.DX_Effect.Description.GlobalVariableCount; } }
        public EffectParameter this[int index]
        {
            get { return new EffectParameter(effect.DX_Effect.GetVariableByIndex(index)); }
        }
        public EffectParameter this[string name]
        {
            get { return new EffectParameter(effect.DX_Effect.GetVariableByName(name)); }
        }
        public IEnumerator<EffectParameter> GetEnumerator() { return this; }
        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this; }
        public EffectParameter Current { get { return this[current]; } }
        public void Dispose() { }
        object System.Collections.IEnumerator.Current { get { return this[current]; } }
        public bool MoveNext() { current++; return current < Count; }
        public void Reset() { current = -1; }
    }

}

#region EffectStuffToImplement
/*
        // Summary:
        //     Initializes a new instance of this class, specifying the graphics device
        //     to associate with this effect and the effect to clone. Reference page contains
        //     links to related code samples.
        //
        // Parameters:
        //   graphicsDevice:
        //     The graphics device that will create the effect.
        //
        //   cloneSource:
        //     The effect to clone.
        protected Effect(GraphicsDevice graphicsDevice, Effect cloneSource);
        //
        // Summary:
        //     Initializes a new instance of this class from a compiled effect, specifying
        //     the compiled effect as a byte array. Reference page contains links to related
        //     code samples.
        //
        // Parameters:
        //   graphicsDevice:
        //     The graphics device that will create the effect.
        //
        //   effectCode:
        //     Byte array containing the compiled byte code.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   pool:
        //     Specifies a pool of resources to share between effects.
        public Effect(GraphicsDevice graphicsDevice, byte[] effectCode, CompilerOptions options, EffectPool pool);
        //
        // Summary:
        //     Initializes a new instance of this class from a compiled effect, specifying
        //     the compiled effect as a stream. Reference page contains links to related
        //     code samples.
        //
        // Parameters:
        //   graphicsDevice:
        //     The graphics device that will create the effect.
        //
        //   effectCodeFileStream:
        //     Stream containing the compiled byte code.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   pool:
        //     Specifies a pool of resources to share between effects.
        public Effect(GraphicsDevice graphicsDevice, Stream effectCodeFileStream, CompilerOptions options, EffectPool pool);
        //
        // Summary:
        //     Initializes a new instance of this class from a compiled effect, specifying
        //     the compiled effect by file name. Reference page contains links to related
        //     code samples.
        //
        // Parameters:
        //   graphicsDevice:
        //     The graphics device that will create the effect.
        //
        //   effectCodeFile:
        //     A file containing a compiled byte code.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   pool:
        //     Specifies a pool of resources to share between effects.
        public Effect(GraphicsDevice graphicsDevice, string effectCodeFile, CompilerOptions options, EffectPool pool);
        //
        // Summary:
        //     Initializes a new instance of this class from a compiled effect, specifying
        //     the compiled effect as a stream, as well as the number of bytes in the stream.
        //     Reference page contains links to related code samples.
        //
        // Parameters:
        //   graphicsDevice:
        //     The graphics device that will create the effect.
        //
        //   effectCodeFileStream:
        //     Stream containing the compiled byte code.
        //
        //   numberBytes:
        //     The number of bytes to read from the file.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   pool:
        //     Specifies a pool of resources to share between effects.
        public Effect(GraphicsDevice graphicsDevice, Stream effectCodeFileStream, int numberBytes, CompilerOptions options, EffectPool pool);

        // Summary:
        //     Gets the name of the effect creator.
        public string Creator { get; }
        //
        // Summary:
        //     Gets an EffectPool representing the pool of shared parameters.
        public EffectPool EffectPool { get; }
        //
        // Summary:
        //     Gets a collection of functions that can render the effect.
        public EffectFunctionCollection Functions { get; }


        // Summary:
        //     Occurs when Dispose is called or when this object is finalized and collected
        //     by the garbage collector of the Microsoft .NET common language runtime (CLR).
        //     Reference page contains code sample.
        public event EventHandler Disposing;
        //
        // Summary:
        //     Occurs when an object is lost, normally just before a device is reset. Reference
        //     page contains code sample.
        public event EventHandler Lost;
        //
        // Summary:
        //     Occurs after the device is reset. Reference page contains code sample.
        public event EventHandler Reset;

        // Summary:
        //     Begins application of the active technique.
        public void Begin();
        //
        // Summary:
        //     Begins application of the active technique, specifying options for saving
        //     state.
        //
        // Parameters:
        //   saveStateMode:
        //     Options for saving the state prior to application of the technique.
        public void Begin(SaveStateMode saveStateMode);
        //
        // Summary:
        //     Creates a clone of an effect.
        //
        // Parameters:
        //   device:
        //     The device associated with the effect.
        public virtual Effect Clone(GraphicsDevice device);
        //
        // Summary:
        //     Propagates the state change that occurs inside of an active pass to the device
        //     before rendering.
        public void CommitChanges();
        //
        // Summary:
        //     Compiles an effect from a stream containing the effect source code.
        //
        // Parameters:
        //   effectFileStream:
        //     File stream containing the effect source code.
        //
        //   preprocessorDefines:
        //     Describes preprocessor definitions used by an effect object.
        //
        //   includeHandler:
        //     User-implemented interface to provide callbacks for #include directives during
        //     shader compilation.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   platform:
        //     The target platform for the compilation.
        public static CompiledEffect CompileEffectFromFile(Stream effectFileStream, CompilerMacro[] preprocessorDefines, CompilerIncludeHandler includeHandler, CompilerOptions options, TargetPlatform platform);
        //
        // Summary:
        //     Compiles an effect from a file containing the effect source code.
        //
        // Parameters:
        //   effectFile:
        //     The name of the file containing the effect source code.
        //
        //   preprocessorDefines:
        //     Describes preprocessor definitions used by an effect object.
        //
        //   includeHandler:
        //     User-implemented interface to provide callbacks for #include directives during
        //     shader compilation.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   platform:
        //     The target platform for the compilation.
        public static CompiledEffect CompileEffectFromFile(string effectFile, CompilerMacro[] preprocessorDefines, CompilerIncludeHandler includeHandler, CompilerOptions options, TargetPlatform platform);
        //
        // Summary:
        //     Compiles an effect from a stream containing the effect source code, specifying
        //     the number of bytes in the stream.
        //
        // Parameters:
        //   effectFileStream:
        //     File stream containing the effect source code.
        //
        //   numberBytes:
        //     The number of bytes in effectFileStream.
        //
        //   preprocessorDefines:
        //     Describes preprocessor definitions used by an effect object.
        //
        //   includeHandler:
        //     User-implemented interface to provide callbacks for #include directives during
        //     shader compilation.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   platform:
        //     The target platform for the compilation.
        public static CompiledEffect CompileEffectFromFile(Stream effectFileStream, int numberBytes, CompilerMacro[] preprocessorDefines, CompilerIncludeHandler includeHandler, CompilerOptions options, TargetPlatform platform);
        //
        // Summary:
        //     Compiles an effect from a string containing the effect source code.
        //
        // Parameters:
        //   effectFileSource:
        //     String containing the effect source code.
        //
        //   preprocessorDefines:
        //     Describes preprocessor definitions used by an effect object.
        //
        //   includeHandler:
        //     User-implemented interface to provide callbacks for #include directives during
        //     shader compilation.
        //
        //   options:
        //     Compilation optimization options.
        //
        //   platform:
        //     The target platform for the compilation.
        public static CompiledEffect CompileEffectFromSource(string effectFileSource, CompilerMacro[] preprocessorDefines, CompilerIncludeHandler includeHandler, CompilerOptions options, TargetPlatform platform);
        //
        // Summary:
        //     Disassembles this effect.
        //
        // Parameters:
        //   enableColorCode:
        //     [MarshalAsAttribute(U1)] true to enable color coding to make the disassembly
        //     easier to read.
        public string Disassemble(bool enableColorCode);
        //
        // Summary:
        //     Disassembles an effect.
        //
        // Parameters:
        //   effect:
        //     The effect to disassemble.
        //
        //   enableColorCode:
        //     [MarshalAsAttribute(U1)] true to enable color coding to make the disassembly
        //     easier to read.
        public static string Disassemble(Effect effect, bool enableColorCode);
        //
        // Summary:
        //     Immediately releases the unmanaged resources used by this object.
        public override sealed void Dispose();
        //
        // Summary:
        //     Releases the unmanaged resources used by the Effect and optionally releases
        //     the managed resources.
        //
        // Parameters:
        //   :
        //     [MarshalAsAttribute(U1)] true to release both managed and unmanaged resources;
        //     false to release only unmanaged resources.
        protected virtual void Dispose(bool __p1);
        //
        // Summary:
        //     Raises the Disposing event when called from within a derived class.
        //
        // Parameters:
        //   value0:
        //     Invoking object reference; should be this object.
        //
        //   value1:
        //     Arguments to pass to the event handler.
        protected void raise_Disposing(object value0, EventArgs value1);
        //
        // Summary:
        //     Raises an Lost event when called from within a derived class.
        //
        // Parameters:
        //   value0:
        //     Invoking object reference; should be this object.
        //
        //   value1:
        //     Arguments to pass into the event handler.
        protected void raise_Lost(object value0, EventArgs value1);
        //
        // Summary:
        //     Raises an Reset event when called from within a derived class.
        //
        // Parameters:
        //   value0:
        //     Invoking object reference; should be this object.
        //
        //   value1:
        //     Arguments to pass into the event handler.
        protected void raise_Reset(object value0, EventArgs value1);
        //
        // Summary:
        //     Retrieves a string representation of this object.
        public override string ToString();
*/
#endregion EffectStuffToImplement

#region EffectParameterCollectionStuffToImplement
/*
    // Summary:
    //     Manipulates a collection of EffectParameter objects.
    public sealed class EffectParameterCollection : IEnumerable<EffectParameter>
    {
        // Summary:
        //     Gets the number of EffectParameter objects in this EffectParameterCollection.
        public int Count { get; }

        // Summary:
        //     Gets a specific EffectParameter object by using an index value.
        //
        // Parameters:
        //   index:
        //     Index of the EffectParameter to get.
        public EffectParameter this[int index] { get; }
        //
        // Summary:
        //     Gets a specific EffectParameter by name.
        //
        // Parameters:
        //   name:
        //     The name of the EffectParameter to retrieve.
        public EffectParameter this[string name] { get; }

        // Summary:
        //     Returns an enumerator that can iterate through the EffectParameterCollection.
        public IEnumerator<EffectParameter> GetEnumerator();
        //
        // Summary:
        //     Gets the handle of a top-level parameter or a structure member parameter
        //     by looking up its semantic with a case-insensitive search.
        //
        // Parameters:
        //   semantic:
        //     The name of the semantic to search for.
        public EffectParameter GetParameterBySemantic(string semantic);
    }
*/
#endregion EffectParameterCollectionStuffToImplement

#region EffectParameterStuffToImplement
/*
        // Summary:
        //     Gets the collection of EffectAnnotation objects for this parameter.
        public EffectAnnotationCollection Annotations { get; }
        //
        // Summary:
        //     Gets the number of columns in the parameter description.
        public int ColumnCount { get; }
        //
        // Summary:
        //     Gets the collection of effect parameters.
        public EffectParameterCollection Elements { get; }
        //
        // Summary:
        //     Gets the name of the parameter.
        public string Name { get; }
        //
        // Summary:
        //     Gets the class of the parameter.
        public EffectParameterClass ParameterClass { get; }
        //
        // Summary:
        //     Gets the type of the parameter.
        public EffectParameterType ParameterType { get; }
        //
        // Summary:
        //     Gets the number of rows in the parameter description.
        public int RowCount { get; }
        //
        // Summary:
        //     Gets the semantic meaning, or usage, of the parameter.
        public string Semantic { get; }
        //
        // Summary:
        //     Gets the collection of structure members.
        public EffectParameterCollection StructureMembers { get; }

        // Summary:
        //     Gets the value of the EffectParameter as a Boolean.
        public bool GetValueBoolean();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Boolean.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public bool[] GetValueBooleanArray(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as an Int32.
        public int GetValueInt32();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Int32.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public int[] GetValueInt32Array(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Matrix.
        public Matrix GetValueMatrix();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Matrix.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public Matrix[] GetValueMatrixArray(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Matrix transpose.
        public Matrix GetValueMatrixTranspose();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Matrix transpose.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public Matrix[] GetValueMatrixTransposeArray(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Quaternion.
        public Quaternion GetValueQuaternion();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Quaternion.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public Quaternion[] GetValueQuaternionArray(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Single.
        public float GetValueSingle();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Single.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public float[] GetValueSingleArray(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as an String.
        public string GetValueString();
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Texture2D.
        public Texture2D GetValueTexture2D();
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Texture3D.
        public Texture3D GetValueTexture3D();
        //
        // Summary:
        //     Gets the value of the EffectParameter as a TextureCube.
        public TextureCube GetValueTextureCube();
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Vector2.
        public Vector2 GetValueVector2();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Vector2.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public Vector2[] GetValueVector2Array(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Vector3.
        public Vector3 GetValueVector3();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Vector3.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public Vector3[] GetValueVector3Array(int count);
        //
        // Summary:
        //     Gets the value of the EffectParameter as a Vector4.
        public Vector4 GetValueVector4();
        //
        // Summary:
        //     Gets the value of the EffectParameter as an array of Vector4.
        //
        // Parameters:
        //   count:
        //     The number of elements in the array.
        public Vector4[] GetValueVector4Array(int count);
        //
        // Summary:
        //     Sets the range of an array to pass to the device.
        //
        // Parameters:
        //   start:
        //     The start index.
        //
        //   end:
        //     The stop index.
        public void SetArrayRange(int start, int end);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(bool[] value);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(float[] value);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(int value);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(int[] value);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(Quaternion value);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(Quaternion[] value);
        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(string value);

        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(Vector2[] value);

        //
        // Summary:
        //     Sets the value of the EffectParameter.
        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(Vector3[] value);
        //

        //
        // Parameters:
        //   value:
        //     The value to assign to the EffectParameter.
        public void SetValue(Vector4[] value);

        //
        // Summary:
        //     Sets the value of the EffectParameter to the transpose of a Matrix.
        //
        // Parameters:
        //   value:
        //     The value.
        public void SetValueTranspose(Matrix[] value);
*/
#endregion EffectParameterStuffToImplement
